import React from 'react';
import './articleIndex.less';
import {
  Form,
  Input,
  Button,
  DatePicker,
  Select,
  Table,
  Icon,
  Radio,
  InputNumber,
  Checkbox,
  Modal,
  message,
  notification,
  Affix,
  Upload,
  Row,
  Col
} from 'antd';
import TWIcon from "components/TWIcon/index";

class EditTreeNode extends React.Component{


  constructor(props) {
    super(props);
  }

  render() {
    if (this.props.editTreeNode) {
      return (<div className="editTreeNodeDivClass">
        <span className="treeNodeTitleClass">{this.props.treeTitle}</span>
        <Button onClick={e=>this.props.editTreeNode(this.props.treeId, this.props.treeTitle, 2)} className="editTreeNodeButtonClass" ><TWIcon type="shanchu" /></Button>
        <Button onClick={e=>this.props.editTreeNode(this.props.treeId, this.props.treeTitle, 1)} className="editTreeNodeButtonClass" ><TWIcon type="bianji" /></Button>
      </div>);
    }else {
      return (<div className="editTreeNodeDivClass">
        <span className="treeNodeTitleClass">{this.props.treeTitle}</span>
      </div>);
    }
  }

  onHahaha(id){
    console.log(id, "------");
  }

}

export default EditTreeNode;
